package de.fhaugsburg.games.boardgames;

import de.fhaugsburg.games.boardgames.scrabble.ScrabbleSquareDetails;

public class Square {
	private IPiece piece;
	private SquareDetails details;

	public Square() {
		piece = null;
	}

	

	public void put(IPiece piece) {
		this.piece = piece;
	}

	public IPiece getPiece() {

		return piece;
	}

	public IPiece removePiece() {
		return this.piece = null;
	}

	public boolean isEmpty() {
		if (piece == null) {
			return true;
		} else {
			return false;
		}

	}

	public SquareDetails getDetails() {
		return details;
	}

	public void setDetails(SquareDetails details) {
		this.details = details;
	}
	public boolean equals(Square square){
		if(this.piece == null && square.getPiece() == null){
			return true;
		}
		if(this.piece == null && square.getPiece() != null){
			return false;
		}
		if(this.piece != null && square.getPiece() == null){
			return false;
		}
		if(this.piece.equals(square.getPiece()) ){
			return true;
		}else{
			return false;
		}
	}

}
